#ifndef KC_TABLEENUMS_H__KC
#define KC_TABLEENUMS_H__KC

#include <string>
#include <map>

namespace kc_sf
{
	// ----------------------------------------------------------- //

	enum ArchiveTableType
	{
		ArchiveMessage,
		ArchiveHeader,
		ArchiveAttachment,
		ArchiveEmail,
		ArchiveMessageTo,
		ArchiveMessageCc,
		ArchiveMessageBcc,
		ArchiveMessageRecipients
	};

	static const std::map <ArchiveTableType, std::string> initArchiveTableTypeToString()
	{
		std::map <ArchiveTableType, std::string> archive_table_names;

		archive_table_names[ ArchiveAttachment ] = "archive_attachment";
		archive_table_names[ ArchiveEmail ] = "archive_email";
		archive_table_names[ ArchiveHeader ] = "archive_header";
		archive_table_names[ ArchiveMessage ] = "archive_message";
		archive_table_names[ ArchiveMessageBcc ] = "archive_message_bcc";
		archive_table_names[ ArchiveMessageCc ] = "archive_message_cc";
		archive_table_names[ ArchiveMessageRecipients ] = "archive_message_recipients";
		archive_table_names[ ArchiveMessageTo ] = "archive_message_to";

		return archive_table_names;
	}

	const std::map <ArchiveTableType, std::string> ArchiveTableTypeToString
	= initArchiveTableTypeToString();

	// ----------------------------------------------------------- //

	enum FilterTableType
	{
		UnknownFilteringTable,
		FilteringRule,
		FilteringKeywordCondition,
		FilteringSizeCondition,
		FilteringCondition,
		FilteringRuleConditions,
		FilteringDateCondition,
		FilteringANrCondition,
		FilteringAttachmentCondition,
		FilteringAddressCondition,
		FilteringResentCondition
	};

	static const std::map <FilterTableType, std::string> initFiterTableTypeMap()
	{
		std::map <FilterTableType, std::string> filter_tables_names;

		filter_tables_names[ FilteringANrCondition ] = "filtering_anrcondition";
		filter_tables_names[ FilteringAddressCondition ] = "filtering_addresscondition";
		filter_tables_names[ FilteringAttachmentCondition ] = "filtering_attachmentcondition";
		filter_tables_names[ FilteringCondition ] = "filtering_condition";
		filter_tables_names[ FilteringDateCondition ] = "filtering_datecondition";
		filter_tables_names[ FilteringKeywordCondition ] = "filtering_keywordcondition";
		filter_tables_names[ FilteringResentCondition ] = "filtering_resentcondition";
		filter_tables_names[ FilteringRule ] = "filtering_rule";
		filter_tables_names[ FilteringRuleConditions ] = "filtering_ruleconditions";
		filter_tables_names[ FilteringSizeCondition ] = "filtering_sizecondition";

		return filter_tables_names;
	}

	const std::map <FilterTableType, std::string> FilterTableTypeToString
	= initFiterTableTypeMap();

	// ----------------------------------------------------------- //

	enum ConditionType
	{
		AttachmentCondition,
		DateCondition,
		FromCondition,
		KeywordCondition,
		AnrCondition,
		SizeCondition,
		ResentCondition,
		SubjectCondition,
		ToCondition
	};

	// ----------------------------------------------------------- //

	enum ConfigurationColumn
	{
		ConfigurationId = 0,
		Sessions,
		Domain,
		ListenPort,
		LogsFilepath,
		LogsLevel,
		MsgMaxSize,
		AllowAntivir,
		AllowTmpMsgs,
		SslListenPort,
		ServerAddress,
		ServerPort,
		RedirectAddress
	};

	// ----------------------------------------------------------- //

	enum StatusTableType
	{
		UnknownStatusTable,
		StatusSystemStart,
		StatusSnapshot
	};

	static const std::map <StatusTableType, std::string> initStatusTableTypeMap()
	{
		std::map <StatusTableType, std::string> status_tables_names;

		status_tables_names[ StatusSystemStart ] = "status_systemstart";
		status_tables_names[ StatusSnapshot ] = "status_snapshot";

		return status_tables_names;
	}

	const std::map <StatusTableType, std::string> StatusTableTypeToString
	= initStatusTableTypeMap();

	// ----------------------------------------------------------- //
}

#endif /* KC_TABLEENUMS_H__KC */
